/* Video Call Modal Styles */
.video-call-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-call-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-call-modal.fullscreen {
    background-color: #000;
}

.video-call-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    position: relative;
    color: #fff;
    transition: all 0.3s ease;
}

.fullscreen .video-call-container {
    max-width: 100%;
    max-height: 100%;
}

/* Video Call Header */
.video-call-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-call-header.hidden {
    opacity: 0;
    transform: translateY(-100%);
}

.call-info {
    display: flex;
    align-items: center;
}

.call-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-details h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.call-status {
    font-size: 0.85rem;
    opacity: 0.8;
}

.call-actions {
    display: flex;
    gap: 12px;
}

.call-action-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.call-action-btn:hover {
    opacity: 1;
}

.call-timer {
    font-size: 1rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 15px;
    letter-spacing: 1px;
}

/* Video Container */
.video-container {
    flex: 1;
    position: relative;
    background-color: #000;
    overflow: hidden;
    box-sizing: border-box;
}

.remote-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remote-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.local-video-container {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 160px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 5;
    cursor: pointer;
}

.local-video-container:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
}

.local-video-container.swapped {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border: none;
    border-radius: 0;
    z-index: 4;
}

.remote-video-container.swapped {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 160px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.local-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

/* Call Controls */
.call-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 40px;
    gap: 15px;
    z-index: 10;
    width: fit-content;
    margin: 0 auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.call-controls.hidden {
    opacity: 0;
    transform: translateY(100%);
}

.call-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.call-control-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.call-control-btn.disabled {
    background-color: rgba(255, 0, 0, 0.2);
}

.call-control-btn.end-call, 
.call-control-btn.reject-call {
    background-color: #e74c3c;
}

.call-control-btn.end-call:hover, 
.call-control-btn.reject-call:hover {
    background-color: #c0392b;
}

.call-control-btn.accept-call {
    background-color: #2ecc71;
}

.call-control-btn.accept-call:hover {
    background-color: #27ae60;
}

.call-control-btn.fullscreen-toggle {
    background-color: rgba(255, 255, 255, 0.15);
}

.fullscreen .call-control-btn.fullscreen-toggle .fa-expand {
    display: none;
}

.fullscreen .call-control-btn.fullscreen-toggle .fa-compress {
    display: inline;
}

.call-control-btn.fullscreen-toggle .fa-expand {
    display: inline;
}

.call-control-btn.fullscreen-toggle .fa-compress {
    display: none;
}

/* Toast notification for video call errors */
.video-call-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.video-call-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .local-video-container {
        width: 100px;
        height: 80px;
        bottom: 80px;
        right: 10px;
    }
    
    .call-control-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .call-controls {
        gap: 10px;
        padding: 10px;
    }
}

/* Animations for call status */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

#call-status {
    animation: pulse 2s infinite;
}

.active-call #call-status {
    animation: none;
}

/* Screen sharing mode */
.screen-sharing .remote-video-container video {
    object-fit: contain;
}

.screen-sharing .local-video-container {
    width: 120px;
    height: 90px;
    bottom: 100px;
}

/* Voice call mode */
.voice-call .video-container {
    background-color: #1a2236;
    background-image: radial-gradient(circle at center, #2c3e50 0%, #1a2236 100%);
}

.voice-call .remote-video-container,
.voice-call .local-video-container {
    display: none;
}

.voice-call .video-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background-image: url('/images/avatar.png');
    background-size: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

.voice-call .video-container::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: pulse-ring 1.5s ease infinite;
}

@keyframes pulse-ring {
    0% {
        width: 200px;
        height: 200px;
        opacity: 0.6;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* Connection status indicators */
.connection-quality {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.connection-quality i {
    color: #2ecc71;
}

.connection-quality.medium i {
    color: #f39c12;
}

.connection-quality.poor i {
    color: #e74c3c;
}

/* Contact item highlight for incoming/outgoing calls */
.contact-item.calling {
    animation: calling-highlight 1.5s infinite;
    background-color: rgba(46, 204, 113, 0.1);
    border-left: 3px solid #2ecc71;
}

@keyframes calling-highlight {
    0% {
        background-color: rgba(46, 204, 113, 0.1);
    }
    50% {
        background-color: rgba(46, 204, 113, 0.3);
    }
    100% {
        background-color: rgba(46, 204, 113, 0.1);
    }
} 